/*
 *
 */
#ifndef USERSTATETABLE_H
#define USERSTATETABLE_H

#ifdef __cplusplus
extern          "C" {
#endif


#include <net-snmp/net-snmp-config.h>
#include <net-snmp/library/container.h>
#include <net-snmp/agent/table_array.h>

#include "../../config.h"

/*
 * The minimum time interval between two snmp requests in second
 */
#define UserStateTable_UPDATE_INTERVAL 10


        /** Index UserId is internal */

    typedef struct UserStateTable_context_s {

        netsnmp_index   index;

    /*************************************************************
     * You can store data internally in this structure.
     *
     * TODO: You will probably have to fix a few types here...
     */
        /** UNSIGNED32 = ASN_UNSIGNED */
        unsigned long   UserId;

        /** INTEGER = ASN_INTEGER */
        long            UserState;

        void           *data;

    } UserStateTable_context;

    /*************************************************************
     * function declarations
     */
    void            init_UserStateTable(void);

    void            initialize_table_UserStateTable(void);

    const UserStateTable_context *UserStateTable_get_by_idx(netsnmp_index *);

    const UserStateTable_context *UserStateTable_get_by_idx_rs(netsnmp_index *, int row_status);

    int UserStateTable_get_value(netsnmp_request_info *,
                                 netsnmp_index *,
                                 netsnmp_table_request_info *);

/*************************************************************
 * oid declarations
 */
    extern const oid UserStateTable_oid[];

    extern const size_t UserStateTable_oid_len;

#define UserStateTable_TABLE_OID 1,3,6,1,4,1,3001,2,2

/*************************************************************
 * column number definitions for table UserStateTable
 */
#define COLUMN_USERID 1
#define COLUMN_USERSTATE 2

#define UserStateTable_COL_MIN 1
#define UserStateTable_COL_MAX 2

/**********************************************
 *  DB definitions
 */
#define TABLE_USR_PRIVATEINFO   "usr_privateinfo"

#define TABLE_LOCATION          "location"

#define COLUMN_USERNAME         "username"

#define QUERY_COUNT  1

/*
 * comment out the following line if you don't want a custom sort
 */
#define UserStateTable_CUSTOM_SORT


#ifdef UserStateTable_CUSTOM_SORT
    UserStateTable_context *UserStateTable_get(const char *name, int len);
#endif

#ifdef __cplusplus
}
#endif
#endif /** USERSTATETABLE_H */
